package org.example.plugins;

public class GetDataSourceName {
    public static String get(String id) {
        long hash = Long.parseLong(id) % 100;
        String dsKey = "master";
        if (0 <= hash && hash <= 50) {
            dsKey = "shard01";
        } else if (51 <= hash) {
            dsKey = "shard02";
        }
        return dsKey;
    }
}
